Skip to content

Fix bazel build //... failure caused by missing JSON schema files in Sphinx source tree#201

Open
VukPavicRTRK wants to merge 4 commits into
eclipse-score:mainfrom
VukPavicRTRK:issue-199-needs-bazel-target-fix
Open

Fix bazel build //... failure caused by missing JSON schema files in Sphinx source tree#201
VukPavicRTRK wants to merge 4 commits into
eclipse-score:mainfrom
VukPavicRTRK:issue-199-needs-bazel-target-fix

Conversation

@VukPavicRTRK
Copy link
Copy Markdown
Contributor

@VukPavicRTRK VukPavicRTRK commented May 15, 2026

Problem

bazel build --config=x86_64-linux //... was failing because literalinclude directives in the docs
traversed up from the Sphinx source tree to src/…, but Bazel's sandbox only
populates the execroot — not the _sources/ directory that Sphinx operates in.
This caused the build to break for any contributor running a top-level build.

Root Cause

When Sphinx runs inside a Bazel action (//:needs_json), the CWD is the
execroot and JSON schema files are linked there at their workspace-relative
paths. However, the Sphinx source tree lives under
bazel-out/…/_needs_json/_sources/, which Bazel does not populate with those
files automatically. literalinclude directives traversing up to src/…
therefore resolved to _sources/src/…, which didn't exist.

Changes

BUILD — adds //src/launch_manager_daemon/config/config_schema:config_schema_files
as a data dependency of the docs target so the schema files are available in
the sandbox.

src/launch_manager_daemon/config/config_schema/BUILD — introduces a
config_schema_files filegroup that exposes all JSON files under the directory
with public visibility.

docs/conf.py — adds a setup() hook that copies the schema files from
the execroot into the Sphinx source tree at the path literalinclude expects.
The copy is guarded so it is a no-op for non-Bazel runs (local sphinx-build
or bazel run //:docs) where the files already exist at the expected location.

Testing

# Should now pass cleanly
bazel build --config=x86_64-linux //...

# Existing targeted builds should be unaffected
bazel build //src/... --config=x
bazel build //:docs

Notes

  • No RST files or the external docs macro were modified.
  • The conf.py copy is intentionally defensive (if src_json_dir.exists() and not dest_json_dir.exists()) to avoid interfering with incremental builds or
    local workflows.

Closes #199

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 15, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.4.2) and connecting to it...
INFO: Invocation ID: 96a6ff80-1943-4a94-ad83-5b6570df6c6b
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (29 packages loaded, 10 targets configured)

Analyzing: target //:license-check (84 packages loaded, 10 targets configured)

Analyzing: target //:license-check (134 packages loaded, 2176 targets configured)

Analyzing: target //:license-check (146 packages loaded, 6030 targets configured)

Analyzing: target //:license-check (157 packages loaded, 8082 targets configured)

Analyzing: target //:license-check (157 packages loaded, 8094 targets configured)

Analyzing: target //:license-check (161 packages loaded, 10106 targets configured)

INFO: Analyzed target //:license-check (162 packages loaded, 10232 targets configured).
[12 / 16] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes; 0s disk-cache, processwrapper-sandbox ... (2 actions, 1 running)
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 20.601s, Critical Path: 2.50s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@VukPavicRTRK VukPavicRTRK force-pushed the issue-199-needs-bazel-target-fix branch from a5f9b1b to 92ae971 Compare May 15, 2026 12:36
@VukPavicRTRK VukPavicRTRK temporarily deployed to workflow-approval May 15, 2026 12:36 — with GitHub Actions Inactive
@VukPavicRTRK VukPavicRTRK temporarily deployed to workflow-approval May 15, 2026 12:36 — with GitHub Actions Inactive
@VukPavicRTRK VukPavicRTRK marked this pull request as ready for review May 15, 2026 12:39
filegroup(
name = "config_schema_files",
srcs = glob(["**/*.json"]),
visibility = ["//visibility:public"],
Copy link
Copy Markdown
Contributor

@NicolasFussberger NicolasFussberger May 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the global expression subsumes the json schema, but also the default values json files and the example configuration. Making all these files publicly accessible via bazel.

While you could argue the json schema should be public for users to validate their config manually if they wish, the other json files are only for our documentation build.

I am wondering if it makes sense to split this into the json schema that should be public and the other json files as private. So that only make artifacts public that are meant to be public. Or alternatively, changing the visibility to making the whole file group only visible within the lifecycle repo.

@VukPavicRTRK VukPavicRTRK temporarily deployed to workflow-approval May 18, 2026 09:02 — with GitHub Actions Inactive
@VukPavicRTRK VukPavicRTRK temporarily deployed to workflow-approval May 18, 2026 09:02 — with GitHub Actions Inactive
@FScholPer FScholPer deployed to workflow-approval May 18, 2026 10:09 — with GitHub Actions Active
@FScholPer FScholPer temporarily deployed to workflow-approval May 18, 2026 10:09 — with GitHub Actions Inactive
@NicolasFussberger
Copy link
Copy Markdown
Contributor

For me bazel build //... is still failing. But this looks like an unrelated issue, it seems to be compiling with treating warnings as errors and then fails due to a deprecation warning from baselibs.

fun1rlz@FE-C-011AX:~/score/lifecycle_rtrk/lifecycle$ bazel build //...
WARNING: Build options --@@score_baselibs+//score/json:base_library, --@@score_baselibs+//score/mw/log/flags:KRemote_Logging, --define, and 4 more have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
WARNING: /home/fun1rlz/.cache/bazel/_bazel_fun1rlz/d7f0ec28ae0af70f689f6042100ef458/external/score_baselibs+/score/mw/log/detail/text_recorder/BUILD:35:11: in cc_library rule @@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder: target '@@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder' depends on deprecated target '@@score_baselibs+//score/os/utils:high_resolution_steady_clock': Deprecated, please use //platform/aas/mw/time/HighPrecisionLocalSteadyClock instead
ERROR: /home/fun1rlz/score/lifecycle_rtrk/lifecycle/src/lifecycle_client_lib/BUILD:175:11: Compiling src/lifecycle_client_lib/src/application.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //src/lifecycle_client_lib:application_mock) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++17' -MD -MF ... (remaining 45 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
./src/lifecycle_client_lib/include/applicationcontext.h:41:82: error: 'using StringLiteral = const char*' is deprecated: No longer supported. Use std::string, std::string_view, safecpp::zstring_view, or const char* depending on your use case [-Werror=deprecated-declarations]
   41 |     ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[]);
      |                                                                                  ^
In file included from ./src/lifecycle_client_lib/include/applicationcontext.h:17,
                 from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
external/score_baselibs+/score/memory/string_literal.h:19:7: note: declared here
   19 | using StringLiteral
      |       ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

@VukPavicRTRK
Copy link
Copy Markdown
Contributor Author

I don't get that error. I'm using a clean devcontainer

For me bazel build //... is still failing. But this looks like an unrelated issue, it seems to be compiling with treating warnings as errors and then fails due to a deprecation warning from baselibs.

fun1rlz@FE-C-011AX:~/score/lifecycle_rtrk/lifecycle$ bazel build //...
WARNING: Build options --@@score_baselibs+//score/json:base_library, --@@score_baselibs+//score/mw/log/flags:KRemote_Logging, --define, and 4 more have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
WARNING: /home/fun1rlz/.cache/bazel/_bazel_fun1rlz/d7f0ec28ae0af70f689f6042100ef458/external/score_baselibs+/score/mw/log/detail/text_recorder/BUILD:35:11: in cc_library rule @@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder: target '@@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder' depends on deprecated target '@@score_baselibs+//score/os/utils:high_resolution_steady_clock': Deprecated, please use //platform/aas/mw/time/HighPrecisionLocalSteadyClock instead
ERROR: /home/fun1rlz/score/lifecycle_rtrk/lifecycle/src/lifecycle_client_lib/BUILD:175:11: Compiling src/lifecycle_client_lib/src/application.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //src/lifecycle_client_lib:application_mock) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++17' -MD -MF ... (remaining 45 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
./src/lifecycle_client_lib/include/applicationcontext.h:41:82: error: 'using StringLiteral = const char*' is deprecated: No longer supported. Use std::string, std::string_view, safecpp::zstring_view, or const char* depending on your use case [-Werror=deprecated-declarations]
   41 |     ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[]);
      |                                                                                  ^
In file included from ./src/lifecycle_client_lib/include/applicationcontext.h:17,
                 from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
external/score_baselibs+/score/memory/string_literal.h:19:7: note: declared here
   19 | using StringLiteral
      |       ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

You are missing the --config=x86_64-linux in your build command. I'm running the build with bazel build --config=x86_64-linux //.... Without the config flag I also get that error.

@NicolasFussberger
Copy link
Copy Markdown
Contributor

I don't get that error. I'm using a clean devcontainer

For me bazel build //... is still failing. But this looks like an unrelated issue, it seems to be compiling with treating warnings as errors and then fails due to a deprecation warning from baselibs.

fun1rlz@FE-C-011AX:~/score/lifecycle_rtrk/lifecycle$ bazel build //...
WARNING: Build options --@@score_baselibs+//score/json:base_library, --@@score_baselibs+//score/mw/log/flags:KRemote_Logging, --define, and 4 more have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
WARNING: /home/fun1rlz/.cache/bazel/_bazel_fun1rlz/d7f0ec28ae0af70f689f6042100ef458/external/score_baselibs+/score/mw/log/detail/text_recorder/BUILD:35:11: in cc_library rule @@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder: target '@@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder' depends on deprecated target '@@score_baselibs+//score/os/utils:high_resolution_steady_clock': Deprecated, please use //platform/aas/mw/time/HighPrecisionLocalSteadyClock instead
ERROR: /home/fun1rlz/score/lifecycle_rtrk/lifecycle/src/lifecycle_client_lib/BUILD:175:11: Compiling src/lifecycle_client_lib/src/application.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //src/lifecycle_client_lib:application_mock) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++17' -MD -MF ... (remaining 45 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
./src/lifecycle_client_lib/include/applicationcontext.h:41:82: error: 'using StringLiteral = const char*' is deprecated: No longer supported. Use std::string, std::string_view, safecpp::zstring_view, or const char* depending on your use case [-Werror=deprecated-declarations]
   41 |     ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[]);
      |                                                                                  ^
In file included from ./src/lifecycle_client_lib/include/applicationcontext.h:17,
                 from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
external/score_baselibs+/score/memory/string_literal.h:19:7: note: declared here
   19 | using StringLiteral
      |       ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

You are missing the --config=x86_64-linux in your build command. I'm running the build with bazel build --config=x86_64-linux //.... Without the config flag I also get that error.

Okay, then its fine. I was only building without the "--config" because the PR description states that bazel build //... would work.

@VukPavicRTRK
Copy link
Copy Markdown
Contributor Author

I don't get that error. I'm using a clean devcontainer

For me bazel build //... is still failing. But this looks like an unrelated issue, it seems to be compiling with treating warnings as errors and then fails due to a deprecation warning from baselibs.

fun1rlz@FE-C-011AX:~/score/lifecycle_rtrk/lifecycle$ bazel build //...
WARNING: Build options --@@score_baselibs+//score/json:base_library, --@@score_baselibs+//score/mw/log/flags:KRemote_Logging, --define, and 4 more have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
WARNING: /home/fun1rlz/.cache/bazel/_bazel_fun1rlz/d7f0ec28ae0af70f689f6042100ef458/external/score_baselibs+/score/mw/log/detail/text_recorder/BUILD:35:11: in cc_library rule @@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder: target '@@score_baselibs+//score/mw/log/detail/text_recorder:text_recorder' depends on deprecated target '@@score_baselibs+//score/os/utils:high_resolution_steady_clock': Deprecated, please use //platform/aas/mw/time/HighPrecisionLocalSteadyClock instead
ERROR: /home/fun1rlz/score/lifecycle_rtrk/lifecycle/src/lifecycle_client_lib/BUILD:175:11: Compiling src/lifecycle_client_lib/src/application.cpp failed: (Exit 1): gcc failed: error executing CppCompile command (from target //src/lifecycle_client_lib:application_mock) /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer '-std=c++17' -MD -MF ... (remaining 45 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
In file included from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
./src/lifecycle_client_lib/include/applicationcontext.h:41:82: error: 'using StringLiteral = const char*' is deprecated: No longer supported. Use std::string, std::string_view, safecpp::zstring_view, or const char* depending on your use case [-Werror=deprecated-declarations]
   41 |     ApplicationContext(const std::int32_t argc, const score::StringLiteral argv[]);
      |                                                                                  ^
In file included from ./src/lifecycle_client_lib/include/applicationcontext.h:17,
                 from ./src/lifecycle_client_lib/include/application.h:17,
                 from src/lifecycle_client_lib/src/application.cpp:14:
external/score_baselibs+/score/memory/string_literal.h:19:7: note: declared here
   19 | using StringLiteral
      |       ^~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

You are missing the --config=x86_64-linux in your build command. I'm running the build with bazel build --config=x86_64-linux //.... Without the config flag I also get that error.

Okay, then its fine. I was only building without the "--config" because the PR description states that bazel build //... would work.

I will edit the description

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bazel build //... fails due to needs_json target

3 participants